package com.xjtu.platform.admin.role.dao;

import com.xjtu.platform.admin.role.ChangeWebDto;
import com.xjtu.platform.admin.role.DeleteDto;
import com.xjtu.platform.admin.role.RoleDto;
import com.xjtu.platform.admin.role.RoleModel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface RoleDao {

    @Select("select role_id,role_web from role_model")
   List<RoleModel> findRole(RoleDto roleDto);

    @Update("update role_model set role_web=#{new_web} where role_id=#{role_id}")
    void changeWeb(ChangeWebDto changeWebDto);

    @Delete("delete from role_model where role_id=#{role_id}")
    void deleteRole_model(DeleteDto deleteDto);

    @Delete("delete from role where role_id=#{role_id}")
    void deleteRole(DeleteDto deleteDto);
}
